#{extends 'main.html' /} 

#{set 'moreScripts'}
<script type="text/javascript">
$(document).ready( function() {
	$('a.lightbox').lightBox();
});
</script>
#{/set}

#{if userAction ==
controllers.Offers$UserAction.CREATE}
<p class ="info">A new offer has been created as follows:</p>
#{/if} #{if userAction == controllers.Offers$UserAction.EDIT}
<p class ="info">The offer has been edited and now looks as follows:</p>
#{/if} #{if userAction == controllers.Offers$UserAction.DELETE}
<p class ="info">The offer has been deleted.</p>
#{/if} #{if offer != null}
<table id = "offer">
 <tr>
  <td><h3>Offer</h3></td>
  <td></td>
  <td><h3>Contact</h3></td>
 </tr>
 <tr>
  <td>
   <table border="0">
    <tr>
     <td>start date</td>
     <td>${offer.startDate.format('dd.MM.yy')}</td>
    </tr>
    <tr>
     <td>end date</td>
     <td>${offer.endDate.format('dd.MM.yy')}</td>
    </tr>
    <tr>
     <td>event</td>
     <td>${offer.event.name}</td>
    </tr>
    <tr>
     <td>street</td>
     <td>${offer.street}</td>
    </tr>
    <tr>
     <td>street number</td>
     <td>${offer.streetNumber}</td>
    </tr>
    <tr>
     <td>city</td>
     <td>${offer.city}</td>
    </tr>
    <tr>
     <td>zip code</td>
     <td>${offer.zipcode}</td>
    </tr>    
    <tr>
     <td>price</td>
     <td>${offer.price}</td>
    </tr>
    <tr>
     <td>room size</td>
     <td>${offer.size}</td>
    </tr>
    <tr>
     <td>description</td>
     <td>${offer.description}</td>
    </tr>
   </table>
  </td>
  <td valign = "top"><a class="lightbox" href="@{Offers.showPicture(offer.id)}"><img height="100" width="100" src="@{Offers.showPicture(offer.id)}"></a></td>
  <td valign = "top">${offerer.firstname} ${offerer.lastname} #{if offerer.email}
   <br> Email:<a class=showOfferDetails
   href="mailto:${offerer.email}?subject=Your offer on A Place to Stay for: ${offer.event.name} | in: ${offer.city} | from: ${offer.startDate.format('dd-MM-yyyy')} | to: ${offer.endDate.format('dd-MM-yyyy')} &amp;body=insert your message">
    ${offerer.email} </a> #{/if} #{if offerer.telephone} <br>Tel.:
   ${offerer.telephone} #{/if}
  </td>
 </tr>
</table>
#{if flash.fromPrice}
<a class=text
 href="@{Application.showOffers(offer.event.id, flash.fromPrice, flash.toPrice, flash.includePrivate)}">back</a>
 #{/if}
#{if user && user.id == offerer.id && offer != null || user && user.isAdmin()}
 <a class="text" href="@{Offers.edit(offer.id)}">&nbsp;edit
 offer&nbsp;</a>
<a class="text" href="@{Offers.delete(offer.id)}">&nbsp;delete
 offer&nbsp;</a>
#{/if}
#{/if}